package com.taxer.service.impl;

import com.taxer.db.dao.AdminMapper;
import com.taxer.db.entity.Admin;
import com.taxer.exception.TaxerExcepiton;
import com.taxer.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by gx on 2017/9/15.
 */
@Service("adminService")
public class AdminServiceImpl implements AdminService {

    @Resource
    private AdminMapper adminMapper;

    @Override
    public Admin getAdminByName(String name) throws TaxerExcepiton {
        try {
            Admin result=adminMapper.selectByName(name);
            return result;
        }catch (Exception e){
            throw new TaxerExcepiton("数据库异常");
        }
    }

}
